package com.rykj.qxj.server.services;

import com.github.pagehelper.PageInfo;
import com.rykj.qxj.server.model.entity.Task;
import com.rykj.qxj.server.model.entity.TaskHistory;

import java.util.List;
import java.util.Map;


public interface ITaskService {


    public void saveTask(Task task) throws  Exception;

    public void updateTask(Task task) throws Exception;

    public void deleteTask(Integer id,String taskName)throws  Exception;

    public Task getTaskDetails(Integer id) ;

    public PageInfo getTaskList(Integer pageNum, Integer pageSize, String taskName, String tableName, String executeType,
                                String taskStatus,Integer applyId,Integer databaseId,Integer tableId);

    public PageInfo getAuditMetadataList(Integer pageNum, Integer pageSize,Integer taskId);


    public PageInfo getUnTaskFields(Integer pageNum, Integer pageSize, Integer tableId);

    public List<Map<String, Object>> getFieldRules(Integer taskId);

    public Map<String, Object> getDatabaseInfoByTaskId(Integer taskId);

    public void updateTaskStatus(String taskStatus,Integer taskId,String taskName,String time)throws  Exception  ;

    public void updateTaskExecuteTime(Integer taskId);

    /**
     * 服务重启时,重启正常的任务
     * @return
     */
    public List<Map<String,Object>> getAllNormalTasks();

    public List<Integer> getTaskIdByName(String taskName);


    public void saveTaskHistory(TaskHistory taskHistory);

    public void updateTaskHistoryType(TaskHistory taskHistory);
}
